home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
6_14.lha
/
6_14
/
6_14b.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
527b
|
25 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ class tiny from section 6.3.2
/ rewritten to use member definitions
lass tiny
char v;
int assign(int i)
{
return v = (i&~63) ?
(error("range error"),0) :
i;
}
ublic:
tiny(int i) { assign(i); }
tiny(tiny& t) { v = t.v; }
int operator=(tiny&t) { return v = t.v; }
int operator=(int i) { return assign(i); }
operator int() { return v; }
;